import { defineStore } from "pinia";
import { ref } from "vue";

// 定义仓库 存储单元
export const countStore = defineStore('counter', () => {
    const count = ref(0)
    const cutCount = () => {
        count.value--
    }
    const addCount = () => {
        count.value++
    }
    return { count, cutCount, addCount }
},{
    persist:true   //添加第三个参数，仓库持久化
})